Multiple developers customarily collaborate when writing source code. When collaborating, different developers independently work on separate modules or portions of the source code file. Source code management systems facilitate the collaborative authoring process by different developers. In most source code management systems, developers check-out a file or module, make changes, and check the file or module back into the source code management system. The newly checked-in file or module is assigned a version number, and that version is associated with an author. In addition to tracking the version number and author as part of the source code management system, the file or module may have additional metadata containing version and author information.
While working on a portion of source code, a developer may have questions regarding code written or changed by another developer in an earlier version of the code. It may be beneficial for developers to be able to identify the individual who introduced, modified, or deleted a specific portion of code in the current or a previous version of the source code. Most source code management systems provide some level of version control that indicates dates, times, and the author responsible for creating or modifying a version. Some source code management systems track changes by line, some track by module, and some source code management systems do not track changes at all.
SVN (Subversion) and CVS (Concurrent. Versions System or “Cederqvist”) are two commonly used source code management systems. SVN and CVS track changes to source code by line. Line-by-line tracking systems become cumbersome after multiple revisions, because the annotations include every prior revision. Further, these systems do not track the authors by segments or modules of the source code file. CMVC (Conversion Management Version Control) is a source code management system developed by IBM®. CMVC does not track versions by line, but rather tracks versions by module. CMVC assigns a version number to each new version of a module and associates the module version with the name of the developer who checks the module into the source code management system.
When a developer using CMVC needs to identify an author who made a specific change within a module, the developer manually executes a file comparison. For example, the developer may use the DIFF command to compare two versions of a module. DIFF compares the contents of two files, and the output is a line-by-line listing of the differences. The developer can determine who made changes to a specific version from the file information for that version. Depending on the file size, the DIFF output can be very extensive, and difficult to sort through. To find the instance where a specific line or code segment changes, developers may have to duplicate the comparison across multiple versions of the file. To compare multiple versions of a file, the developer must repeat the manual comparison for each version. Manual file comparisons using DIFF can be tedious and time consuming. Developers are prone to make errors when manually reviewing many lines of code, and especially when manually reviewing changes across multiple versions of the code.
A need exists for a way to automate file comparisons for a selected portion of code within a file across multiple versions of the file. A need further exists for an automated comparison to identify the file version where a change in the code occurred, and to associate the change to the author of the change. These and other objects of the invention will be apparent to those skilled in the art from the following detailed description of a preferred embodiment of the invention.